

import java.io.IOException;
import java.util.Scanner;

public class StudentEnrol
{

	//-----------------------------------------------------------------
	// Constructor
	//-----------------------------------------------------------------

	public void addStudent()
	{
		StudentRecord stu = new StudentRecord();
		Scanner sc = new Scanner(System.in);
		System.out.println("\t\t欢迎使用学生管理系统");
		System.out.println("\t\t**********增加学生***************");
		System.out.println("\t\tFirstName:");
		 stu.setFname(sc.next());
		System.out.println("\t\tLastName:");
		String LName = sc.next();
		stu.setLname(LName);
		System.out.println("\t\tID:");
		String ID = sc.next();
		stu.setMub(ID);
		System.out.println("\t\tmajor:");
		String Ma = sc.next();
		stu.setId(Ma);
		System.out.println("\t\tfree:");
		String free = sc.next();
		stu.setFree(free);
		UserManager rw = new UserManager();
		
		try {
			rw.writeTxtFile(stu.toString(), System.getProperty("user.dir")+"/File3.txt");
		} catch (IOException e) {
		System.out.println("写入文件有问题O(∩_∩)O~请与系统管理员联系，系统将自动退出。");
		
		}
		
		System.out.println("增加学生成功！！！！！！！！！！！！！！！！！");
		ListSort c = new ListSort();
		c.showMain();
	}
	
	
	public StudentEnrol()
		{
		}

	//-----------------------------------------------------------------
	// Check that all the classes are reachable
	// This should be removed from your final program 	
	//-----------------------------------------------------------------
	public void call()
		{
		
		}

	//-----------------------------------------------------------------
	// Method for testing that class has been reached
	// This should be removed from your final program 	
	//-----------------------------------------------------------------	
	public boolean studentEnrolReached()
		{
			call();
			return true;			
		}
		
    } // end of studentEnrol class 
//-----------------------------------------------------------------
